package com.ie.controller.before;



import com.ie.common.http.ResponseResult;
import com.ie.common.security.anno.AuthIgrone;
import com.ie.entity.OrdersEntity;
import com.ie.sevice.admin.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 订单管理控制器
 */
@RestController
@RequestMapping("/api/admin/orders")
public class OrdersContoller {

    @Autowired
    private OrdersService ordersService;

    /**
     * 查询所有订单列表（支持分页和条件查询）------------对
     */

    @AuthIgrone
    @GetMapping("/list")
    public ResponseResult<Map<String, Object>> getAllOrders(@RequestBody OrdersEntity ordersEntity) {
        System.out.println("查询成功");
        return ordersService.getAllOrders(ordersEntity);
    }

    /**
     * 查询订单详情......对
     */
//    @AuthIgrone
//    @GetMapping("/detail")
//    public ResponseResult<List<Map<String, Object>>> getOrdersDetail(OrdersEntity ordersEntity) {
//        return ordersService.getOrdersDetail(ordersEntity);
//    }


    /**
     * 提交订单（含清空购物车）---------部分
     */


//    /**
//     * 提交订单（不清空购物车）---------部分
//     */
//    @AuthIgrone
//    @PostMapping("/goSubmit")
//    public ResponseResult<OrdersEntity> goSubmitOrder(@RequestBody OrdersEntity ordersEntity) {
//        return ordersService.goSubmitOrder(ordersEntity);
//    }
//
//
//    /**
//     * 查询用户订单列表--------对
//     */
//    @AuthIgrone
//    @GetMapping("/user")
//    public ResponseResult<Map<String, Object>> getOrdersByUid(@RequestBody OrdersEntity ordersEntity) {
//        return ordersService.getOrdersByUid(ordersEntity);
//    }

}

